package org.example.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.sql.Time;
import java.util.LinkedList;
import java.util.List;

@Data
@AllArgsConstructor
/**
 * 充电记录表接口
 * 返回一个List<BatteryHisInfo>
 */
public class BatteryHisInfo {
    private String packNo;
    private String imei;
    private List<TimeseriesData> rackTotalCurrent; // 当前总电流 Double 单位A
    private List<TimeseriesData> rackTotalVoltage; // 当前总电压 Double 单位V
    private List<TimeseriesData> rackMaxCellVoltage; // 单体最高电压 Integer 单位mv
    private List<TimeseriesData> rackMaxVolCellID; // 单体最高电压对应序号 Integer
    private List<TimeseriesData> rackMinCellVoltage; // 单体最低电压 Integer 单位mv
    private List<TimeseriesData> rackMinVolCellID; // 单体最低电压对应序号 Integer
    private List<TimeseriesData> rackSOC; // Double 单位百分比
    private List<TimeseriesData> rackSOH; // Double 单位百分比
    private List<TimeseriesData> cellHightTemp; // Double
    private List<TimeseriesData> cellLowTemp; // Double
    private List<TimeseriesData> electricChargeSum; // 充电总量
    private List<TimeseriesData> electricDischargeSum; // 放电总量

    public BatteryHisInfo(){
        this.packNo=null;
        this.imei=null;
        this.rackTotalCurrent=new LinkedList<>();
        this.rackTotalVoltage=new LinkedList<>();
        this.rackMaxCellVoltage=new LinkedList<>();
        this.rackMaxVolCellID=new LinkedList<>();
        this.rackMinCellVoltage=new LinkedList<>();
        this.rackMinVolCellID=new LinkedList<>();
        this.rackSOC=new LinkedList<>();
        this.rackSOH=new LinkedList<>();
        this.cellHightTemp=new LinkedList<>();
        this.cellLowTemp=new LinkedList<>();
        this.electricChargeSum=new LinkedList<>();
        this.electricDischargeSum=new LinkedList<>();
    }

    public void addToRackTotalCurrent(TimeseriesData data){
        this.rackTotalCurrent.add(data);
    }
    public void addToRackTotalVoltage(TimeseriesData data) {
        this.rackTotalVoltage.add(data);
    }
    public void addToRackMaxCellVoltage(TimeseriesData data) {
        this.rackMaxCellVoltage.add(data);
    }
    public void addToRackMaxVolCellID(TimeseriesData data) {
        this.rackMaxVolCellID.add(data);
    }
    public void addToRackMinCellVoltage(TimeseriesData data) {
        this.rackMinCellVoltage.add(data);
    }
    public void addToRackMinVolCellID(TimeseriesData data) {
        this.rackMinVolCellID.add(data);
    }
    public void addToRackSOC(TimeseriesData data) { this.rackSOC.add(data); }
    public void addToRackSOH(TimeseriesData data) { this.rackSOH.add(data); }
    public void addToCellHightTemp(TimeseriesData data) { this.cellHightTemp.add(data); }
    public void addToCellLowTemp(TimeseriesData data) { this.cellLowTemp.add(data); }
    public void addToElectricChargeSum(TimeseriesData data) { this.electricChargeSum.add(data); }
    public void addToElectricDischargeSum(TimeseriesData data) { this.electricDischargeSum.add(data); }

}

